package com.feicheng.controller.wx;

import com.alibaba.fastjson.JSONObject;
import com.feicheng.common.result.ResultInfo;
import com.feicheng.service.a.FJlService;
import com.feicheng.service.a.FXyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController("/wx/jl")
@RequestMapping("/wx/jl")
public class JlController {

    @Autowired
    FJlService jlService;

    @Autowired
    FXyService fXyService;

    @PostMapping("/page")
    public ResultInfo getJlByPage(@RequestBody JSONObject param) {
        param = jlService.getJlByPage(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/info/put")
    public ResultInfo updateJl(@RequestBody JSONObject param) {
        param = jlService.updateJl(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/info/get")
    public ResultInfo getJldetail(@RequestBody JSONObject param) {
        param = jlService.getJl(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/yj/in")
    public ResultInfo inYj(@RequestBody JSONObject param) {
        param = jlService.yjin(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/yj/out")
    public ResultInfo outYj(@RequestBody JSONObject param) {
        param = jlService.yjout(param);
        return ResultInfo.success();
    }

    //会员类型详细-
    @PostMapping("/hylx/get")
    public ResultInfo getHylxByid(@RequestBody JSONObject param) {
        param = jlService.getHylx(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/hylx/info")
    public ResultInfo newHylx(@RequestBody JSONObject param) {
        param = jlService.newHylx(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/hylx/page")
    public ResultInfo getHylxByPage(@RequestBody JSONObject param) {
        param = jlService.getHylxs(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/pj/page")
    public ResultInfo getJlpjByPage(@RequestBody JSONObject param) {
        param = jlService.getPjBypage(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/pj/list")
    public ResultInfo getJlpjByList(@RequestBody JSONObject param) {
        param = jlService.getPjByList(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/pj")
    public ResultInfo newPj(@RequestBody JSONObject param) {
        param = jlService.pjJl(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/pj/get")
    public ResultInfo getJlpj(@RequestBody JSONObject param) {
        param = jlService.getPj(param);
        return ResultInfo.success(param);
    }

    @PostMapping("/fx/reject")
    public ResultInfo getRejectFx(@RequestBody JSONObject param) {
        param = jlService.rejectFx(param);
        return ResultInfo.success(param);
    }
}
